import request from '@/utils/request'

export function Get(id, args) {
  return request({
    url: `/erp/api/crawl_product_image/${id || ''}${args && ('?' + args) || ''}`,
    method: 'get'
  })
}

export function Post(data) {
  return request({
    url: '/erp/api/crawl_product_image/',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}

export function Put(id, data) {
  return request({
    url: `/erp/api/crawl_product_image/${id || ''}`,
    headers: { 'content-type': 'application/json' },
    method: 'put',
    data: JSON.stringify(data)
  })
}

export function Delete(id, data) {
  return request({
    url: `/erp/api/crawl_product_image/${id || ''}`,
    data: JSON.stringify(data),
    method: 'delete'
  })
}

export function ImageSync(data) {
  return request({
    url: '/erp/api/crawl_image_sync/',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}

export function SetMainImage(data) {
  return request({
    url: '/erp/api/crawl_image_main/',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}
